# coding:UTF-8
from django.shortcuts import render
import pymongo
import datetime
import random
# Create your views here.


# def _mongodb_get_conn(database_name):
#     """测试连接mongodb
#     :param database_name 数据库名
#     """
#     client = pymongo.MongoClient('localhost', 27017)
#     return client[database_name]
#
# #
# db = _mongodb_get_conn('ssm')
# ssm = db.ssm
# print ssm.find_one()
#
# # post = {"author": "Mike",
# #         "text": "My first blog post!",
# #         "tags": ["mongodb", "python", "pymongo"],
# #         "date": datetime.datetime.utcnow()
# #         }
# # res = ssm.insert_one(post)
#
# print ssm



